package com.yhb.service;

import com.yhb.channel.dao.flow.ExecutionFlow;
import com.yhb.channel.model.IBankCard;
import com.yhb.channel.model.TryBindCardExtendInfo;
import com.yhb.controller.vo.SimpleVerifyCodeTokenVo;
import com.yhb.model.Card;
import com.yhb.model.RapidCheat;
import com.yhb.model.ThirdPurchaseFlow;
import com.yhb.model.User;
import com.yhb.model.mq.SumUpParam;
import me.edzh.spring.bootstrap.model.Tuple;

import java.math.BigDecimal;
import java.util.List;

public interface TradeService {

    /**
     * 提交快收申请. 返回验证码token
     */
    SimpleVerifyCodeTokenVo commitRapidCheat(String consumeCardId, String remitCardId, BigDecimal amount, User user, String province, String city, String district);

    RapidCheat executeRapidCheat(String token, String verifyCode, User user);

    RapidCheat rapidFlow(String flowId, String userId);

    RapidCheat rapidFlow(String flowId);

    List<RapidCheat> userList(String userId, RapidCheat.Type type, String monthString);

    String pay(String channelType,
               String appId,
               String userId,
               String payCardId,
               BigDecimal orderAmount,
               String clientIP,
               String province,
               String city,
               String area,
               String callbackUrl);

    String remit(String channelType,
                 String appId,
                 String userId,
                 Card remitCard, // 收款银行卡
                 Card consumeCard,
                 BigDecimal amount,
                 String callbackUrl);

    boolean checkBind(String channelType,
                      String cardId,
                      String userId,
                      boolean isRemitCard);


    String sendBindCardSms(String channelType,
                           String userId,
                           String cardId,
                           String clientIP);

    String bindCardConfirm(String channelType,
                           String smsCode,
                           String userId,
                           String smsUUID);

    void callbackExecutionFlow(ExecutionFlow flow, ThirdPurchaseFlow thirdPurchaseFlow);
    void callbackExecutionFlow(com.yhb.yinsheng.model.ExecutionFlow flow, ThirdPurchaseFlow thirdPurchaseFlow);

    void clearUserReservedBalance(User user);
    void checkThirdFlow(String dateString, String thirdFlowId);

//
//    Tuple<BigDecimal, BigDecimal> sumUpAmount(SumUpParam param);
//
//    void sumUpSplitting(String date, String monthString);
//
//    /**
//     * 启动计算分润. 进行交易量最终核算, vip 定级等任务, 计算完成后进行分发, 逐笔计算分润
//     */
//    void startSumUpSplitting(String monthString);
//    void startSumUpSplitting();

//    BigDecimal getYesterdayFlowSumUp(User user);
//    BigDecimal getThisMonthSumUp(User user);
//    BigDecimal getLastMonthSumUp(User user);
}
